@extends('layouts.default')

@section('title', '课题研究')

@push('scripts')
<script src="{{ asset('lib/xm-select-v1.2.4/xm-select.js')}}"></script>
<script>
    layui.use(['layer','form','table','laytpl','laydate','element','laypage','upload'], function(){
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var laytpl = layui.laytpl;
        var laydate = layui.laydate;
        var element = layui.element;
        var laypage = layui.laypage;
        var upload = layui.upload;
        var cxmDemo;
        var pxmDemo;
        var PageId = "{{request()->get('id',0)}}";
        
        var sbbFiles = [];
        var lxzmFiles = [];
        var zqbgFiles = [];
        var jtbgFiles = [];
        var jtzsFiles = [];

        renderSelect();

        laydate.render({
            elem: '#begin-date'
            ,type: 'date'
        });
        laydate.render({
            elem: '#end-date'
            ,type: 'date'
        });
        laydate.render({
            elem: '#lxbegin-date'
            ,type: 'date'
        });
        laydate.render({
            elem: '#lxend-date'
            ,type: 'date'
        });
        laydate.render({
            elem: '#zqbegin-date'
            ,type: 'date'
        });
        laydate.render({
            elem: '#zqend-date'
            ,type: 'date'
        });
        laydate.render({
            elem: '#jxsj-date'
            ,type: 'date'
        });

        //下拉框初始化
        async function renderSelect(){
            await renderDictionarySelect();
            await renderTermSelect();
            await renderCompere();
            await renderParticipants();
            pageInit();
        }

        //字典下拉框数据渲染
        function renderDictionarySelect() {
            return new Promise((resolve) => {
                getDictionaryItem({'diccode': ['LEVEL']}, function (res){
                    if(res.code === 1) {  
                        let data = res.data;

                        for(var k in data) {
                            let key = k.toLowerCase();
                            let d = data[k];
                            
                            $('[data-role='+key+'List]').empty().append('<option value="">请选择</option>');
                            for (var i in d) {
                                $('[data-role='+key+'List]').append('<option value="' + d[i].optionId + '">' + d[i].selectValue + '</option>');
                            }
                        }
                        
                        form.render(); 
                        
                        resolve();
                    }
                });
            });
        }

        //学期下拉框数据渲染
        function renderTermSelect() {
            return new Promise((resolve) => {
                getTermData({},function(res){
                    if(res.code == 1){
                        $('[data-role=termList]').empty().append('<option value="">请选择</option>');
                        for(var i in res.data){
                            $('[data-role=termList]').append('<option value="'+res.data[i].id+'">'+res.data[i].title+'</option>');
                        }
                                      
                        form.render('select');

                        resolve();
                    }
                });  
            });
        } 

        //主持人下拉框数据渲染
        function renderCompere() {
            return new Promise((resolve) => {
                getParticipantsData({},function(res){
                    if(res.code == 1){
                        cxmDemo = xmSelect.render({
                            el: '#cter', 
                            autoRow: true,
                            filterable: true,
                            tree: {
                                show: true,
                                showFolderIcon: true,
                                showLine: true,
                                indent: 20,
                                expandedKeys:false
                            },   
                            direction: 'down',          
                            filterable: true,
                            height: 'auto',
                            name: 'compere',
                            layVerify: 'required',
                            layVerType: 'msg',
                            layReqText: '主持人不能为空',
                            theme: {
                                color: '#2d8cf0',
                            },
                            model: {
                                label: {
                                    type: 'block',
                                    block: {
                                        //最大显示数量, 0:不限制
                                        showCount: 0,
                                        //是否显示删除图标
                                        showIcon: false,
                                    }
                                }
                            },
                            disabled:true,
                            searchTips:'关键字搜索',
                            data: function(){
                                return res.data
                            }
                        });

                        return resolve();
                    }
                });  
            });
        }

        //参与教师下拉框数据渲染
        function renderParticipants() {
            return new Promise((resolve) => {
                getParticipantsData({},function(res){
                    if(res.code == 1){
                        pxmDemo = xmSelect.render({
                            el: '#pter', 
                            autoRow: true,
                            filterable: true,
                            tree: {
                                show: true,
                                showFolderIcon: true,
                                showLine: true,
                                indent: 20,
                                expandedKeys:false
                            }, 
                            direction: 'down',            
                            filterable: true,
                            height: 'auto',
                            name: 'participant',
                            layVerify: 'required',
                            layVerType: 'msg',
                            layReqText: '参与教师不能为空',
                            theme: {
                                color: '#2d8cf0',
                            },
                            model: {
                                label: {
                                    type: 'block',
                                    block: {
                                        //最大显示数量, 0:不限制
                                        showCount: 0,
                                        //是否显示删除图标
                                        showIcon: false,
                                    }
                                }
                            },
                            disabled:true,
                            searchTips:'关键字搜索',
                            data: function(){
                                return res.data
                            }
                        });

                        return resolve();
                    }
                });  
            });
        }

        // 文件显示
        function fileShow(files) {
            let oldFiles = {};
            let showFiles = {};
            layui.each(files, function(i, d) {
                if(d.field) {
                    if (showFiles[d.field]) {
                        showFiles[d.field].push(d);
                    } else {
                        showFiles[d.field] = [d];
                    }
                } else {
                    if (showFiles['sbb']) {
                        showFiles['sbb'].push(d);
                    } else {
                        showFiles['sbb'] = [d];
                    }
                }
            });

            layui.each(showFiles, function(f, d) {
                let fileShowTpl = fileShowDemo.innerHTML
                    ,fileShow = document.getElementById('file-show-'+f);
                    
                laytpl(fileShowTpl).render(d, function(html){
                    fileShow.innerHTML = html;                           
                });
            });
        }

        //数据渲染
        function pageInit(){
            getActivityOne({id:PageId}, function(res) {
                if(res.code === 1) {
                    let Activity = res.data;
                    let Stages = Activity.stages;

                    form.val('infoForm', {
                        'id': PageId,
                        'data_version_id': Activity.data_version_id,
                        'name': Activity.name,
                        'begin_date': Activity.begin_date,
                        'end_date': Activity.end_date,
                        'level': Activity.level_array[0].optionId,
                        'activity_category': Activity.activity_category,
                        'stage': Activity.stage,
                        'created_at': Activity.created_at
                    });
                    // 创建人
                    if(Activity.creator){
                        var creatorName = '<button class="layui-btn layui-btn-primary" type="button">' + Activity.creator.nickname + '</button>';
                        
                        $("#creator-show").append(creatorName);
                    }

                    //主持人
                    cxmDemo.setValue(Activity.participants_users.pere);
                    //参与教师
                    pxmDemo.setValue(Activity.participants_users.pant);
                    //文件   
                    if(Activity.proof_material_array.length){
                        fileShow(Activity.proof_material_array);
                    }

                    form.val('checkForm1', {
                        'activity_id': PageId,
                    });
                    form.val('checkForm2', {
                        'activity_id': PageId,
                    });
                    form.val('checkForm3', {
                        'activity_id': PageId,
                    });
                    form.val('checkForm4', {
                        'activity_id': PageId,
                    });

                    if(Stages.length > 0) {
                        layui.each(Stages, function(k, item) {
                            form.val('checkForm'+item.stage, {
                                'status': item.status,
                                'comment': item.comment
                            });

                            if(item.stage == Activity.stage) {
                                form.val('infoForm', {
                                    'status': item.status
                                });
                            }

                            if(item.stage == 1) {
                                //文件   
                                if(item.resources_set.length){
                                    let showFiles = {};
                                    layui.each(item.resources_set, function(i, d) {
                                        if(d.field) {
                                            if (showFiles[d.field]) {
                                                showFiles[d.field].push(d);
                                            } else {
                                                showFiles[d.field] = [d];
                                            }
                                        } else {
                                            oldFiles.push(d);
                                        }
                                    });

                                    layui.each(showFiles, function(f, d) {
                                        let fileShowTpl = fileShowDemo.innerHTML
                                            ,fileShow = document.getElementById('file-show-'+f+'1');
                                            
                                        laytpl(fileShowTpl).render(d, function(html){
                                            fileShow.innerHTML = html;                           
                                        });
                                    });
                                } 
                            } else {
                                if(item.stage == 4) {
                                    form.val('infoForm4', {
                                        'end_date': item.end_date
                                    });
                                } else  {
                                    form.val('infoForm'+item.stage, {
                                        'begin_date': item.begin_date,
                                        'end_date': item.end_date
                                    });
                                }
                                
                                if(item.resources_set.length){
                                    fileShow(item.resources_set);
                                } 
                            }
                        });
                    }
                    // 选项卡定位
                    element.tabChange('stagesTab', Activity.stage);

                    form.render();
                } else {
                    layer.msg('无数据记录', {time: 2000, icon: 5});
                }
            });
        }
        
  
        //提交
        form.on('submit(sub1)', function(data){
            let d = data.field;

            checkStage(d, function(res){
                if(res.code == '1'){
                    layer.msg(res.msg,{icon: 6,time: 1000},function(){
                        window.history.back();
                    });
                }else{
                    layer.msg(res.msg, {icon: 5,shift : 6});
                }
            });

            return false;
        });
        form.on('submit(sub2)', function(data){
            let d = data.field;

            checkStage(d, function(res){
                if(res.code == '1'){
                    layer.msg(res.msg,{icon: 6,time: 1000},function(){
                        window.history.back();
                    });
                }else{
                    layer.msg(res.msg, {icon: 5,shift : 6});
                }
            });

            return false;
        });
        form.on('submit(sub3)', function(data){
            let d = data.field;

            checkStage(d, function(res){
                if(res.code == '1'){
                    layer.msg(res.msg,{icon: 6,time: 1000},function(){
                        window.history.back();
                    });
                }else{
                    layer.msg(res.msg, {icon: 5,shift : 6});
                }
            });

            return false;
        });
        form.on('submit(sub4)', function(data){
            let d = data.field;

            checkStage(d, function(res){
                if(res.code == '1'){
                    layer.msg(res.msg,{icon: 6,time: 1000},function(){
                        window.history.back();
                    });
                }else{
                    layer.msg(res.msg, {icon: 5,shift : 6});
                }
            });

            return false;
        });

    });
</script>
@endpush

@section('content')
<style>
    .layui-row{margin-bottom: 10px;}
    .opt-panel{padding: 10px;}
    .panel-title h3{margin-bottom: 20px;font-weight: 800;}

    #stages-card{padding: 30px 15px;}
    .card-title h3{margin-bottom: 20px;font-weight: 800;}
    #stages-tab-content{min-height: 400px;}
    #stages-tab-content h4{font-weight: 800;}

    .opt-form{padding: 20px 5px;}
    .opt-area{display: flex;flex-direction: row-reverse;padding: 10px 20px;margin-bottom: 20px;}
    .opt-area button, .back-btn{margin-left: 10px;}
</style>

<div class="layui-row">
    <div class="layui-panel opt-panel">
        <form class="layui-form opt-form" action="" id="info-form" lay-filter="infoForm">
            <div class="layui-row">
                <div class="panel-title">
                    <h3>课题研究 - 查看</h3>
                </div>
                <div class="layuik-form-item layuik-columns-two">
                    <div class="layuik-inline">
                        <label class="layuik-form-label">学年学期：</label>
                        <div class="layuik-input-inline">
                            <select disabled class="data-version-id" name="data_version_id" lay-filter="termList" data-role="termList" lay-verify="required" lay-reqText="不能为空"></select>
                        </div>
                    </div>
                    <div class="layuik-inline">
                        <label class="layuik-form-label">主题名称：</label>
                        <div class="layuik-input-inline">
                            <input disabled type="text" name="name" required lay-verify="required" placeholder="请输入" lay-reqText="不能为空" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div> 
                <div class="layuik-form-item layuik-columns-two">
                    <div class="layuik-inline">
                        <label class="layuik-form-label">开始日期：</label>
                        <div class="layuik-input-inline">
                            <input disabled type="text" name="begin_date" id="begin-date" required lay-verify="required" placeholder="请选择" lay-reqText="不能为空" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                    <div class="layuik-inline">
                        <label class="layuik-form-label">结束日期：</label>
                        <div class="layuik-input-inline">
                            <input disabled type="text" name="end_date" id="end-date" required lay-verify="required" placeholder="请选择" lay-reqText="不能为空" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
                <div class="layuik-form-item layuik-columns-two">
                    <div class="layuik-inline">
                        <label class="layuik-form-label">级别：</label>
                        <div class="layuik-input-inline">
                            <select disabled name="level" lay-filter="levelList" data-role="levelList" lay-verify="required" lay-reqText="不能为空"></select>
                        </div>
                    </div>
                    <div class="layuik-inline">
                        <label class="layuik-form-label">类别：</label>
                        <div class="layuik-input-inline">
                            <input type="radio" name="activity_category" value="EW_SUBJECT_RESEARCH_TABLE" title="教育" class="layui-radio">
                            <input type="radio" name="activity_category" value="TEARRESEARCH_SUBJECT_STUDY_TABLE" title="教学" class="layui-radio">
                        </div>
                    </div>
                </div> 
                <div class="layuik-form-item">
                    <div class="layuik-inline">
                        <label class="layuik-form-label">主持人：</label>
                        <div class="layuik-input-inline">
                            <div type="text" id="cter" class="xm-select-demo"></div>
                        </div>
                    </div>
                </div>
                <div class="layuik-form-item">
                    <div class="layuik-inline">
                        <label class="layuik-form-label">参与教师：</label>
                        <div class="layuik-input-inline">
                            <div type="text" id="pter" class="xm-select-demo"></div>
                        </div>
                    </div>
                </div> 
                <div class="layuik-form-item layuik-columns-two">
                    <div class="layuik-inline">
                        <label class="layuik-form-label">课题阶段：</label>
                        <div class="layuik-input-inline">
                            <select disabled name="stage" lay-filter="stageList" data-role="stageList" lay-verify="required" lay-reqText="不能为空" disabled>
                                <option value="">请选择</option>
                                <option value="1" selected>申报阶段</option>
                                <option value="2">立项阶段</option>
                                <option value="3">中期阶段</option>
                                <option value="4">结项阶段</option>
                            </select>
                        </div>
                    </div>
                    <div class="layuik-inline">
                        <label class="layuik-form-label">状态：</label>
                        <div class="layuik-input-inline">
                            <select disabled name="status" disabled>
                                <option value="0">未提交</option>
                                <option value="1">待审核</option>
                                <option value="3">已驳回</option>
                            </select>
                        </div>
                    </div>
                </div> 
                <div class="layuik-form-item layuik-columns-two">
                    <div class="layuik-inline">
                        <label class="layuik-form-label">申报表：</label>
                        <div class="layuik-input-inline">
                            <div id="file-show-sbb"></div>
                        </div>
                    </div>
                </div>
                <div class="layuik-form-item layuik-columns-two">
                    <div class="layuik-inline">
                        <label class="layuik-form-label">创建人：</label>
                        <div class="layuik-input-inline" id="creator-show"></div>
                    </div>
                    <div class="layuik-inline">
                        <label class="layuik-form-label">创建时间：</label>
                        <div class="layuik-input-inline">
                            <input disabled type="text" name="created_at" id="created_at" autocomplete="off" class="layui-input">
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>   
</div>
  
<div class="layui-row">
    <div class="layui-card" id="stages-card">
        <div class="card-title">
            <h3>课题研究 - 审核</h3>
        </div>
        <div class="layui-tab layui-tab-brief" lay-filter="stagesTab">
            <ul class="layui-tab-title">
                <li class="layui-this" lay-id="1">申报阶段</li>
                <li lay-id="2">立项阶段</li>
                <li lay-id="3">中期阶段</li>
                <li lay-id="4">结项阶段</li>
            </ul>
            
            <div class="layui-tab-content" id="stages-tab-content">
                <div class="layui-tab-item layui-show">
                    <form class="layui-form opt-form" action="" id="info-form1" lay-filter="infoForm1">
                        <div class="layui-row">
                            <div class="layuik-form-item layuik-columns-two">
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">申报表：</label>
                                    <div class="layuik-input-inline">
                                        <div id="file-show-sbb1"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="layui-card">
                        <div class="layui-card-header"><h4>审核信息</h4></div>
                        <div class="layui-card-body">
                            <form class="layui-form opt-form" action="" id="check-form1" lay-filter="checkForm1">
                                <div class="layui-row">
                                    <div class="layuik-form-item">
                                        <div class="layuik-inline">
                                            <label class="layuik-form-label"><i class="redstar">*</i>审核结果：</label>
                                            <div class="layuik-input-inline">
                                                <input  type="radio" name="status" value="2" title="通过">
                                                <input  type="radio" name="status" value="3" title="驳回" >
                                            </div>
                                        </div>
                                    </div> 
                                    <div class="layuik-form-item">
                                        <div class="layuik-inline">
                                            <label class="layuik-form-label">原因：</label>
                                            <div class="layuik-input-inline">
                                                <textarea  name="comment" placeholder="请输入内容" class="layui-textarea"></textarea>
                                            </div>
                                        </div>
                                    </div> 
                                </div>
                                
                                <div class="layui-row">
                                    <div class="opt-area">
                                        <a href="javascript:history.go(-1);" class="layui-btn layui-btn-primary back-btn">返回</a>
                                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="sub1">提交</button>
                                        <input type="hidden" name="stage" value="1">
                                        <input type="hidden" name="activity_id" value="">
                                    </div> 
                                </div>
                            </form>
                        </div>
                    </div>
                </div>  
                <div class="layui-tab-item">
                    <form class="layui-form opt-form" action="" id="info-form2" lay-filter="infoForm2">
                        <div class="layui-row">
                            <div class="layuik-form-item layuik-columns-two">
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">开始时间：</label>
                                    <div class="layuik-input-inline">
                                        <input disabled type="text" name="begin_date" id="lxbegin-date" required lay-verify="required" placeholder="请选择" lay-reqText="不能为空" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">结束时间：</label>
                                    <div class="layuik-input-inline">
                                        <input disabled type="text" name="end_date" id="lxend-date" required lay-verify="required" placeholder="请选择" lay-reqText="不能为空" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layuik-form-item layuik-columns-two">
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">立项证明：</label>
                                    <div class="layuik-input-inline">
                                        <div id="file-show-lxzm"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="layui-card">
                        <div class="layui-card-header"><h4>审核信息</h4></div>
                        <div class="layui-card-body">
                            <form class="layui-form opt-form" action="" id="check-form2" lay-filter="checkForm2">
                                <div class="layui-row">
                                    <div class="layuik-form-item">
                                        <div class="layuik-inline">
                                            <label class="layuik-form-label"><i class="redstar">*</i>审核结果：</label>
                                            <div class="layuik-input-inline">
                                                <input  type="radio" name="status" value="2" title="通过">
                                                <input  type="radio" name="status" value="3" title="驳回" >
                                            </div>
                                        </div>
                                    </div> 
                                    <div class="layuik-form-item">
                                        <div class="layuik-inline">
                                            <label class="layuik-form-label">原因：</label>
                                            <div class="layuik-input-inline">
                                                <textarea  name="comment" placeholder="请输入内容" class="layui-textarea"></textarea>
                                            </div>
                                        </div>
                                    </div> 
                                </div>
                                
                                <div class="layui-row">
                                    <div class="opt-area">
                                        <a href="javascript:history.go(-1);" class="layui-btn layui-btn-primary back-btn">返回</a>
                                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="sub2">提交</button>
                                        <input type="hidden" name="stage" value="2">
                                        <input type="hidden" name="activity_id" value="">
                                    </div> 
                                </div>
                            </form>
                        </div>
                    </div>
                </div> 
                <div class="layui-tab-item">
                    <form class="layui-form opt-form" action="" id="info-form3" lay-filter="infoForm3">
                        <div class="layui-row">
                            <div class="layuik-form-item layuik-columns-two">
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">开始时间：</label>
                                    <div class="layuik-input-inline">
                                        <input disabled type="text" name="begin_date" id="zqbegin-date" required lay-verify="required" placeholder="请选择" lay-reqText="不能为空" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">结束时间：</label>
                                    <div class="layuik-input-inline">
                                        <input disabled type="text" name="end_date" id="zqend-date" required lay-verify="required" placeholder="请选择" lay-reqText="不能为空" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layuik-form-item layuik-columns-two">
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">中期报告：</label>
                                    <div class="layuik-input-inline">
                                        <div id="file-show-zqbg"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                    <!-- <div class="layui-card">
                        <div class="layui-card-header"><h4>审核信息</h4></div>
                        <div class="layui-card-body">
                            <form class="layui-form opt-form" action="" id="check-form3" lay-filter="checkForm3">
                                <div class="layui-row">
                                    <div class="layuik-form-item">
                                        <div class="layuik-inline">
                                            <label class="layuik-form-label"><i class="redstar">*</i>审核结果：</label>
                                            <div class="layuik-input-inline">
                                                <input  type="radio" name="status" value="2" title="通过">
                                                <input  type="radio" name="status" value="3" title="驳回" >
                                            </div>
                                        </div>
                                    </div> 
                                    <div class="layuik-form-item">
                                        <div class="layuik-inline">
                                            <label class="layuik-form-label">原因：</label>
                                            <div class="layuik-input-inline">
                                                <textarea  name="comment" placeholder="请输入内容" class="layui-textarea"></textarea>
                                            </div>
                                        </div>
                                    </div> 
                                </div>
                                
                                <div class="layui-row">
                                    <div class="opt-area">
                                        <a href="javascript:history.go(-1);" class="layui-btn layui-btn-primary back-btn">返回</a>
                                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="sub3">提交</button>
                                        <input type="hidden" name="stage" value="3">
                                        <input type="hidden" name="activity_id" value="">
                                    </div> 
                                </div>
                            </form>
                        </div>
                    </div> -->
                </div> 
                <div class="layui-tab-item">
                    <form class="layui-form opt-form" action="" id="info-form4" lay-filter="infoForm4">
                        <div class="layui-row">
                            <div class="layuik-form-item layuik-columns-two">
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">结项时间：</label>
                                    <div class="layuik-input-inline">
                                        <input disabled type="text" name="end_date" id="jxsj-date" required lay-verify="required" placeholder="请选择" lay-reqText="不能为空" autocomplete="off" class="layui-input">
                                    </div>
                                </div>
                            </div>
                            <div class="layuik-form-item layuik-columns-two">
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">结题报告：</label>
                                    <div class="layuik-input-inline">
                                        <div id="file-show-jtbg"></div>
                                    </div>
                                </div>
                            </div>
                            <div class="layuik-form-item layuik-columns-two">
                                <div class="layuik-inline">
                                    <label class="layuik-form-label">结题证书：</label>
                                    <div class="layuik-input-inline">
                                        <div id="file-show-jtzs"></div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                    <div class="layui-card">
                        <div class="layui-card-header"><h4>审核信息</h4></div>
                        <div class="layui-card-body">
                            <form class="layui-form opt-form" action="" id="check-form4" lay-filter="checkForm4">
                                <div class="layui-row">
                                    <div class="layuik-form-item">
                                        <div class="layuik-inline">
                                            <label class="layuik-form-label"><i class="redstar">*</i>审核结果：</label>
                                            <div class="layuik-input-inline">
                                                <input  type="radio" name="status" value="2" title="通过">
                                                <input  type="radio" name="status" value="3" title="驳回" >
                                            </div>
                                        </div>
                                    </div> 
                                    <div class="layuik-form-item">
                                        <div class="layuik-inline">
                                            <label class="layuik-form-label">原因：</label>
                                            <div class="layuik-input-inline">
                                                <textarea  name="comment" placeholder="请输入内容" class="layui-textarea"></textarea>
                                            </div>
                                        </div>
                                    </div> 
                                </div>
                                
                                <div class="layui-row">
                                    <div class="opt-area">
                                        <a href="javascript:history.go(-1);" class="layui-btn layui-btn-primary back-btn">返回</a>
                                        <button class="layui-btn layui-btn-normal" lay-submit lay-filter="sub4">提交</button>
                                        <input type="hidden" name="stage" value="4">
                                        <input type="hidden" name="activity_id" value="">
                                    </div> 
                                </div>
                            </form>
                        </div>
                    </div>
                </div>  
            </div>  
        </div>
    </div>
</div>
  
<script id="fileShowDemo" type="text/html">
<ul>
@{{#  layui.each(d, function(index, item){ }}
@{{#  if(item){ }}
    <li style="min-width: 200px;margin: 13px 5px;">
        <a style="color: #0e90d2;" target="_blank" title="@{{item.file_info.file_name}}" href="@{{item.file_info.file_dir}}@{{item.file_info.file_path}}">
            <span style="display: inline-block;max-width: 90%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;">@{{item.file_info.file_name}}</span>
        </a>
        <a style="color:#74B8FF" href="@{{item.file_info.file_dir}}@{{item.file_info.file_path}}" download="@{{item.file_info.file_name}}">
            <span class="icon pear-icon pear-icon-download" style="color:#74B8FF;margin-left:10px;"></span>
        </a>
    </li>
@{{#  } }}
@{{#  }); }}
</ul>
</script>
@endsection